package com.qf.fc.controller;



import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.fc.Param.LikeAdd;
import com.qf.fc.entity.MoodLike;
import com.qf.fc.service.MoodLikeService;
import com.qf.fc.vo.R;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

/**
 * 动态点赞表(MoodLike)表控制层
 *
 * @author makejava
 * @since 2024-09-23 23:34:47
 */
@RestController
@RequestMapping("/api/mlike/")
@Tag(name = "动态点赞接口") //knife4j 接口文档
public class MoodLikeController {
    /**
     * 服务对象
     */
    @Resource
    private MoodLikeService service;


    @PostMapping("add")
    public R<String> addMl(@RequestBody LikeAdd add){
        System.out.println("请求成功到达。");
        System.out.println(add.getLid()+"---"+add.getUid());
        return service.addLike(add);
    }
    /**
     * 查询我的点赞
     */
    @PostMapping("my")
    public R myMlikes(Integer uid){
        return service.queryMy(uid);
    }
    /**
     * 检查是否点赞
     */
    @GetMapping("check")
    public R checkMlike(@RequestParam Integer uid, @RequestParam Integer mid){
        System.out.println(uid+"---"+mid);
        return service.checkLike(uid, mid);
    }
}

